export default {
	data() {
		return {
			recommendList: []
		}
	},
	methods: {
		async getRecommendList() {
			const projectAuth = !!this.projectInfo.userApproveId ? '1' : '0'
			
			const shopUrl = uni.getStorageSync('shopUrl')
			if (!shopUrl) {
				return
			}

			const res = await this.$Posting(`${shopUrl}/api/gruul-mall-search/search/product`, {
				current: 1,
				size: 4,
				recommendState: 1,
				orderByParams: [
					{
						order: "createTime",
						sort: "desc"
					}
				]
			}, {
				'Project-Id': this.projectInfo.projectId,
				'Project-Auth': projectAuth
			})
			
			if (res.code !== 200) {
				return
			}
			console.log('=+++++++==')
			console.log(res.data.list)
			this.recommendList = res.data.list
		}
	}
}